
import requests

url = 'https://www.ip138.com/'
headers = {
    'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'
}
# 代理
proxies = { "http":"47.122.65.254:8080" }
response = requests.get(url=url, headers=headers, proxies=proxies)
response.encoding = 'utf-8'
html = response.text # 以字符串的形式返回网页源码
print(html)

f = open('../download/wz.html','w',encoding='utf-8')
f.write(html)
f.close()

